#include"processBar.h"
#include<string.h>
#include<unistd.h>

#define RED "\033[0;32;31m"
#define _RED "\033[1;31m"
#define _PURPLE "\033[1;35m"
#define NONE "\033[m"
const char*lable="|/-\\";
void processbar()
{
    char bar[NUM];
    memset(bar,'\0',sizeof(bar));
    int len=strlen(lable);
    int cnt=0;
    while(cnt<=100)
    {
        printf(RED"[%-100s][%d%%][%c]\r"NONE,bar,cnt,lable[cnt%len]);
        fflush(stdout);
        bar[cnt++]=STYLE;
        if(cnt<100)bar[cnt]='>';
        usleep(50000);
    }
    printf("\n");
}
